Custom Printer Library  1.17
customprnapi.cpp File Reference

Contains all library APIs. Main file for CuCustomLnxAPI library. More...

#include "customprnapi.h"

Functions

CcwResult InitLibrary (CcwLogVerbosity logVerbosityLevel, char *pstrLogFolder)
 
CcwResult DeInitLibrary ()
 
CcwResult CloseDevice (int device)
 
CcwResult CloseAllDevices ()
 
CcwResult GetAPIVersion (char *pAPIVersion)
 
CcwResult GetInfoPrinterId (int device, WORD *pwPrinterID)
 
CcwResult GetInfoFirmwareVersion (int device, char *pFirmwareVersion)
 
CcwResult GetInfoDeviceModel (int device, char *pDeviceModel)
 
CcwResult GetCapCommPortType (int device, CommunicationPortType *pcomPortType)
 
CcwResult GetCapPrintAvailable (int device, BOOL *pbPrnAvailable)
 
CcwResult GetCapPrinterResolution (int device, DWORD *pdwPrinterResolution)
 
CcwResult GetCapPrintWidth (int device, DWORD *pdwPageWidth)
 
CcwResult SetCapPrintWidth (int device, DWORD dwNewPrintWidth)
 
CcwResult CommGetReadTimeout (int device, DWORD *pdwRTimeout)
 
CcwResult CommSetReadTimeout (int device, DWORD dwRTimeout)
 
CcwResult CommGetWriteTimeout (int device, DWORD *pdwWTimeout)
 
CcwResult CommSetWriteTimeout (int device, DWORD dwWTimeout)
 
CcwResult CommClearReadBuffer (int device)
 
CcwResult CommClearWriteBuffer (int device)
 
CcwResult CommRead (int device, BYTE *bDataRead, DWORD dwDataReadSize, DWORD *pdwReadDataSize)
 
CcwResult CommWrite (int device, BYTE *bDataToWrite, DWORD dwDataToWriteSize, DWORD *pdwWrittenData)
 
CcwResult TransactionPrint (DWORD device, TrPrintMode tpMode)
 
CcwResult Feed (int device, DWORD dwnFeeds)
 
CcwResult Cut (int device, CutType cuttype)
 
CcwResult EjectWithTimeout (int device, EjectType ejtype, DWORD dwTimeoutMs)
 
CcwResult Eject (int device, EjectType ejtype)
 
CcwResult Present (int device, DWORD dwpresentMM)
 
CcwResult Align (int device, PaperAlignType aligntype)
 
CcwResult PrinterIsReady (int device, BOOL *pbReady)
 
CcwResult GetPrinterFullStatus (int device, BYTE *pBuffer, PrinterStatusStruct *pStatusStruct)
 
CcwResult ClearPrinterStatisticsField (int device, ClearableField fieldToClear)
 
CcwResult GetPrinterStatistics (int device, PrinterStatisticsStruct *printerStatisticsStruct)
 
CcwResult PrintText (int device, char *pText, BOOL bAddLF)
 
CcwResult PrintTextUTF8 (int device, char *pText, PrintFontStruct *pfontStruct, BOOL bAddLF)
 
CcwResult PrintTextEx (int device, char *pText, PrintFontStruct *pfontStruct, BOOL bAddLF)
 
CcwResult SetIgnoreWhiteImages (int device, BOOL bIgnore)
 
CcwResult SetGrModeToBlackWhite (int device, ImageGRMode imgGrModeType, BYTE bThreshold)
 
CcwResult SetPageModeToRoll (int device, BOOL bRollMode)
 
CcwResult PrintImageFromPath (int device, char *pstrImageFilePath, PrintImageStruct *pImageStruct)
 
CcwResult PrintRawImage (int device, RAWBitDepth bits, BYTE *pRawBuffer, DWORD dwRawBufferSize, DWORD dwWidth, DWORD dwHeight, PrintImageStruct *pImageStruct)
 
CcwResult PrintBarcodeString (int device, char *strBrcText, PrintBarcodeStruct *pBarcodeStruct)
 
CcwResult PrintBarcodeBuffer (int device, BYTE *bBrcBuffer, DWORD dwSrcBufferSize, PrintBarcodeStruct *pBarcodeStruct)
 
CcwResult SetVariable (int device, char *var, void *value)
 
CcwResult GetVariable (int device, char *var, void *value)
 
CcwResult EnumUSBDevices (USBDeviceStruct *pUSBDevicesArray, DWORD *pdwNumDevices)
 
CcwResult OpenPrinterUSB (WORD wVID, WORD wPID, char *pstrSN, int *pPrinterDevID)
 
CcwResult OpenPrinterUSBEx (USBDeviceStruct *pUsbDev, int *pPrinterDevID)
 
CcwResult EnumETHDevices (ETHDeviceStruct *pETHDevicesArray, unsigned long *pdwNumDevices, DWORD dwSearchTimeout)
 
CcwResult OpenPrinterETH (char *strPrinterIPAddress, int dwPrinterIPPort, int *pdeviceID)
 
CcwResult OpenPrinterETHEx (ETHDeviceStruct *pEthDev, int *pPrinterDevID)
 
CcwResult EnumCOMPorts (COMPortStruct *pCOMPortsArray, unsigned long *pdwNumPorts)
 
CcwResult OpenPrinterCOM (char *strPrinterComPort, int *pPrinterDevID)
 
CcwResult OpenPrinterCOMEx (COMPortStruct *pComDev, int *pPrinterDevID)
 

Detailed Description

Contains all library APIs. Main file for CuCustomLnxAPI library.

Function Documentation

◆ Align()

CcwResult Align ( int  device,
PaperAlignType  aligntype 
)

Send align command to the device

Parameters
[in]deviceThe device ID indicating which device the application will communicate to.
[in]aligntypethe PaperAlignType type to send to the device.
Note
This command will be effective only if "black mark alignment" is enabled in printer setup (for further information, refer to the User Manual of each device).
Returns
A CcwResult error code, or CcwResult_OK if the function succeeded.

◆ ClearPrinterStatisticsField()

CcwResult ClearPrinterStatisticsField ( int  device,
ClearableField  fieldToClear 
)

Get the statistics of this device

Parameters
[in]deviceThe device ID indicating which device the application will communicate to.
[in]fieldToClearThe ClearableField field that will be cleared.
Returns
A CcwResult error code, or CcwResult_OK if the function succeeded.

◆ CloseAllDevices()

CcwResult CloseAllDevices ( )

Close the communication with all the devices.

Returns
A CcwResult error code, or CcwResult_OK if the function succeeded.
See also
DeInitLibrary

◆ CloseDevice()

CcwResult CloseDevice ( int  device)

Close the communication with a device.

Parameters
[in]deviceThe device ID indicating which device the application will close the communications.
Returns
A CcwResult error code, or CcwResult_OK if the function succeeded.
See also
DeInitLibrary

◆ CommClearReadBuffer()

CcwResult CommClearReadBuffer ( int  device)

Clean the read buffer of the communication port of this device

Parameters
[in]deviceThe device ID indicating which device the application will communicate to.
Returns
A CcwResult error code, or CcwResult_OK if the function succeeded.

◆ CommClearWriteBuffer()

CcwResult CommClearWriteBuffer ( int  device)

Clean the write buffer of the communication port of this device

Parameters
[in]deviceThe device ID indicating which device the application will communicate to.
Returns
A CcwResult error code, or CcwResult_OK if the function succeeded.

◆ CommGetReadTimeout()

CcwResult CommGetReadTimeout ( int  device,
DWORD *  pdwRTimeout 
)

Get the read timeout of the communication port of this device

Parameters
[in]deviceThe device ID indicating which device the application will communicate to.
[out]pdwRTimeoutA pointer to the number that is the read timeout (msec), for the communication port, of this device.
Returns
A CcwResult error code, or CcwResult_OK if the function succeeded.

◆ CommGetWriteTimeout()

CcwResult CommGetWriteTimeout ( int  device,
DWORD *  pdwWTimeout 
)

Get the write timeout of the communication port of this device

Parameters
[in]deviceThe device ID indicating which device the application will communicate to.
[out]pdwWTimeoutA pointer to the number that is the write timeout (msec), for the communication port, of this device.
Returns
A CcwResult error code, or CcwResult_OK if the function succeeded.

◆ CommRead()

CcwResult CommRead ( int  device,
BYTE *  bDataRead,
DWORD  dwDataReadSize,
DWORD *  pdwReadDataSize 
)

Direct read from communication port of this device

Parameters
[in]deviceThe device ID indicating which device the application will communicate to.
[out]bDataReadpointer to buffer where received data shall stored
[in]dwDataReadSizelength of reserved buffer
[out]pdwReadDataSizepointer to value where the number of received bytes is stored
Returns
A CcwResult error code, or CcwResult_OK if the function succeeded.

◆ CommSetReadTimeout()

CcwResult CommSetReadTimeout ( int  device,
DWORD  dwRTimeout 
)

Set the read timeout of the communication port of this device

Parameters
[in]deviceThe device ID indicating which device the application will communicate to.
[in]dwRTimeoutthe value that will be the new read timeout (msec), for the communication port, of this device.
Returns
A CcwResult error code, or CcwResult_OK if the function succeeded.

◆ CommSetWriteTimeout()

CcwResult CommSetWriteTimeout ( int  device,
DWORD  dwWTimeout 
)

Set the write timeout of the communication port of this device

Parameters
[in]deviceThe device ID indicating which device the application will communicate to.
[in]dwWTimeoutthe value that will be the write timeout (msec), for the communication port, of this device.
Returns
A CcwResult error code, or CcwResult_OK if the function succeeded.

◆ CommWrite()

CcwResult CommWrite ( int  device,
BYTE *  bDataToWrite,
DWORD  dwDataToWriteSize,
DWORD *  pdwWrittenData 
)

Direct write to communication port of this device

Parameters
[in]deviceThe device ID indicating which device the application will communicate to.
[in]bDataToWritepointer to buffer to send
[in]dwDataToWriteSizelength of buffer to send
[out]pdwWrittenDatapointer to value where the number of sent bytes is stored
Returns
A CcwResult error code, or CcwResult_OK if the function succeeded.

◆ Cut()

CcwResult Cut ( int  device,
CutType  cuttype 
)

Send cut command to the device

Parameters
[in]deviceThe device ID indicating which device the application will communicate to.
[in]cuttypethe CutType type to send to the device.
Returns
A CcwResult error code, or CcwResult_OK if the function succeeded.

◆ DeInitLibrary()

CcwResult DeInitLibrary ( )

De-initialize library. Call this function as the last function before your application unloads the library.

Returns
A CcwResult error code, or CcwResult_OK if the function succeeded.
See also
InitLibrary

◆ Eject()

CcwResult Eject ( int  device,
EjectType  ejtype 
)

Send eject command to the device

Parameters
[in]deviceThe device ID indicating which device the application will communicate to.
[in]ejtypethe EjectType type to send to the device.
Returns
A CcwResult error code, or CcwResult_OK if the function succeeded.

◆ EjectWithTimeout()

CcwResult EjectWithTimeout ( int  device,
EjectType  ejtype,
DWORD  dwTimeoutMs 
)

Send eject command to the device

Parameters
[in]deviceThe device ID indicating which device the application will communicate to.
[in]ejtypethe EjectType type to send to the device.
[in]dwTimeoutMsthe time in milliseconds after which the movement is performed.
Returns
A CcwResult error code, or CcwResult_OK if the function succeeded.

◆ EnumCOMPorts()

CcwResult EnumCOMPorts ( COMPortStruct pCOMPortsArray,
unsigned long *  pdwNumPorts 
)

Enum the COM Ports found.

Parameters
[out]pCOMPortsArraythe pointer to COMPortStruct array of all the COM ports found. This array must have been allocated by the calling process.
[out]pdwNumPortsThe pointer to the value indicating the number of COM Ports found.
Note
: if the pCOMPortsArray is NULL the pdwNumPorts indicates always the number of COM Ports found after a new scan process.
Returns
A CcwResult error code, or CcwResult_OK if the function succeeded.

◆ EnumETHDevices()

CcwResult EnumETHDevices ( ETHDeviceStruct pETHDevicesArray,
unsigned long *  pdwNumDevices,
DWORD  dwSearchTimeout 
)

Enum the Ethernet/Wifi devices connected.

Parameters
[out]pETHDevicesArraythe pointer to ETHDeviceStruct array of all the Ethernet/Wifi devices found. This array must have been allocated by the calling process.
[out]pdwNumDevicesThe pointer to the value indicating the number of Ethernet/Wifi devices found.
[in]dwSearchTimeoutThe timeout to search the ethernet / wifi devices
Note
: if the pETHDevicesArray is NULL the pdwNumDevices indicates always the number of Ethernet/Wifi devices found after a new scan process.
Returns
A CcwResult error code, or CcwResult_OK if the function succeeded.

◆ EnumUSBDevices()

CcwResult EnumUSBDevices ( USBDeviceStruct pUSBDevicesArray,
DWORD *  pdwNumDevices 
)

Enum the usb devices connected.

Parameters
[out]pUSBDevicesArraythe pointer to USBDeviceStruct array of all the usb devices found. This array must have been allocated by the calling process.
[out]pdwNumDevicesThe pointer to the value indicating the number of usb devices found.
Note
: if the pUSBDevicesArray is NULL the pdwNumDevices indicates always the number of usb devices found after a new scan process.
Returns
A CcwResult error code, or CcwResult_OK if the function succeeded.

◆ Feed()

CcwResult Feed ( int  device,
DWORD  dwnFeeds 
)

Send line feed commands to the device

Parameters
[in]deviceThe device ID indicating which device the application will communicate to.
[in]dwnFeedsthe number of line feed to send to the device.
Returns
A CcwResult error code, or CcwResult_OK if the function succeeded.

◆ GetAPIVersion()

CcwResult GetAPIVersion ( char *  pAPIVersion)

Current API version

Parameters
[out]pAPIVersionA null terminated string containing the library release. This buffer must have been allocated by the calling process.
Returns
A CcwResult error code, or CcwResult_OK if the function succeeded.

◆ GetCapCommPortType()

CcwResult GetCapCommPortType ( int  device,
CommunicationPortType pcomPortType 
)

Get the type of communication port used by the device

Parameters
[in]deviceThe device ID indicating which device the application will communicate to.
[out]pcomPortTypeA pointer to CommunicationPortType, allocated by the calling process, that contains the communication port type.
Returns
A CcwResult error code, or CcwResult_OK if the function succeeded.

◆ GetCapPrintAvailable()

CcwResult GetCapPrintAvailable ( int  device,
BOOL *  pbPrnAvailable 
)

Get if this device supports print functions.

Parameters
[in]deviceThe device ID indicating which device the application will communicate to.
[out]pbPrnAvailableA pointer to the boolean value to know if this device supports print functions.
Returns
A CcwResult error code, or CcwResult_OK if the function succeeded.

◆ GetCapPrinterResolution()

CcwResult GetCapPrinterResolution ( int  device,
DWORD *  pdwPrinterResolution 
)

Get the print resolution of this device

Parameters
[in]deviceThe device ID indicating which device the application will communicate to.
[out]pdwPrinterResolutionA pointer to the number that is the print resolution.
Returns
A CcwResult error code, or CcwResult_OK if the function succeeded.

◆ GetCapPrintWidth()

CcwResult GetCapPrintWidth ( int  device,
DWORD *  pdwPageWidth 
)

Get the print width of this device

Parameters
[in]deviceThe device ID indicating which device the application will communicate to.
[out]pdwPageWidthA pointer to the number that is the print width (dots) of this device.
Returns
A CcwResult error code, or CcwResult_OK if the function succeeded.

◆ GetInfoDeviceModel()

CcwResult GetInfoDeviceModel ( int  device,
char *  pDeviceModel 
)

Get the Device Model

Parameters
[in]deviceThe device ID indicating which device the application will communicate to.
[out]pDeviceModelA null terminated string containing the Model of this device. This buffer must have been allocated by the calling process.
Returns
A CcwResult error code, or CcwResult_OK if the function succeeded.

◆ GetInfoFirmwareVersion()

CcwResult GetInfoFirmwareVersion ( int  device,
char *  pFirmwareVersion 
)

Get the Firmware Version

Parameters
[in]deviceThe device ID indicating which device the application will communicate to.
[out]pFirmwareVersionA null terminated string containing the Firmware release of this device. This buffer must have been allocated by the calling process.
Returns
A CcwResult error code, or CcwResult_OK if the function succeeded.

◆ GetInfoPrinterId()

CcwResult GetInfoPrinterId ( int  device,
WORD *  pwPrinterID 
)

Get the Printer ID

Parameters
[in]deviceThe device ID indicating which device the application will communicate to.
[out]pwPrinterIDA WORD containing the Printer ID.
Returns
A CcwResult error code, or CcwResult_OK if the function succeeded.

◆ GetPrinterFullStatus()

CcwResult GetPrinterFullStatus ( int  device,
BYTE *  pBuffer,
PrinterStatusStruct pStatusStruct 
)

Get the status of this device

Parameters
[in]deviceThe device ID indicating which device the application will communicate to.
[out]pBufferA pointer to 4 bytes buffer, allocated by the calling process, that contains the printer status.
[out]pStatusStructA pointer to PrinterStatusStruct, allocated by the calling process, that contains the printer status.
Note
At least one of the out pointers (pBuffer or pStatusStruct) must be not NULL.
Returns
A CcwResult error code, or CcwResult_OK if the function succeeded.

◆ GetPrinterStatistics()

CcwResult GetPrinterStatistics ( int  device,
PrinterStatisticsStruct printerStatisticsStruct 
)

Get the statistics of this device

Parameters
[in]deviceThe device ID indicating which device the application will communicate to.
[out]printerStatisticsStructA pointer to PrinterStatisticsStruct, allocated by the calling process, that contains the printer statistics.
Note
printerStatisticsStruct must be not NULL.
Returns
A CcwResult error code, or CcwResult_OK if the function succeeded.

◆ GetVariable()

CcwResult GetVariable ( int  device,
char *  var,
void *  value 
)

Get the value of an internal "parameter"

Parameters
[in]deviceThe device ID indicating which device the application will communicate to.
[in]varA null terminated string that is the variable ID.
[out]valuepointer to the value of the variable.
Note
Only for internal use
Returns
A CcwResult error code, or CcwResult_OK if the function succeeded.

◆ InitLibrary()

CcwResult InitLibrary ( CcwLogVerbosity  logVerbosityLevel,
char *  pstrLogFolder 
)

Initializes library. This must be the first call after the LoadLibrary.

Parameters
[in]logVerbosityLevela CcwLogVerbosity Verbosity level.
[in]pstrLogFolderLog folder path. If NULL or empty, the library uses the default path: "%Home%/CUSTOM/CuCustomLnxAPI/Log".
Returns
A CcwResult error code, or CcwResult_OK if the function succeeded.
See also
DeInitLibrary

◆ OpenPrinterCOM()

CcwResult OpenPrinterCOM ( char *  strPrinterComPort,
int *  pPrinterDevID 
)

Open the communication with a COM port to printer

Parameters
[in]strPrinterComPortthe string with the COM port to open.
[out]pPrinterDevIDThe pointer to the device ID indicating which device the application will communicate to.
Returns
A CcwResult error code, or CcwResult_OK if the function succeeded.

◆ OpenPrinterCOMEx()

CcwResult OpenPrinterCOMEx ( COMPortStruct pComDev,
int *  pPrinterDevID 
)

Open the communication with a COM port to printer

Parameters
[in]pComDevthe COMPortStruct with all the parameters of the COM Port to open.
[out]pPrinterDevIDThe pointer to the device ID indicating which device the application will communicate to.
Returns
A CcwResult error code, or CcwResult_OK if the function succeeded.

◆ OpenPrinterETH()

CcwResult OpenPrinterETH ( char *  strPrinterIPAddress,
int  dwPrinterIPPort,
int *  pdeviceID 
)

Open the communication with a Ethernet / WIFI printer

Parameters
[in]strPrinterIPAddressthe string with the IP Address of the printer to open.
[in]dwPrinterIPPortthe network port to open int the printer. If this value is 0, it is automatically set to the default for the RAW print port (9100)
[out]pdeviceIDThe pointer to the device ID indicating which device the application will communicate to.
Returns
A CcwResult error code, or CcwResult_OK if the function succeeded.

◆ OpenPrinterETHEx()

CcwResult OpenPrinterETHEx ( ETHDeviceStruct pEthDev,
int *  pPrinterDevID 
)

Open the communication with a Ethernet / WIFI printer

Parameters
[in]pEthDevthe ETHDeviceStruct with all the parameters of the ETH/Wifi printer to open.
[out]pPrinterDevIDThe pointer to the device ID indicating which device the application will communicate to.
Returns
A CcwResult error code, or CcwResult_OK if the function succeeded.

◆ OpenPrinterUSB()

CcwResult OpenPrinterUSB ( WORD  wVID,
WORD  wPID,
char *  pstrSN,
int *  pPrinterDevID 
)

Open the communication with a USB printer

Parameters
[in]wVIDthe USB Vendor ID of the printer to open.
[in]wPIDthe USB Product ID of the printer to open.
[in]pstrSNthe USB Serial Number of the printer to open.
[out]pPrinterDevIDThe pointer to the device ID indicating which device the application will communicate to.
Returns
A CcwResult error code, or CcwResult_OK if the function succeeded.

◆ OpenPrinterUSBEx()

CcwResult OpenPrinterUSBEx ( USBDeviceStruct pUsbDev,
int *  pPrinterDevID 
)

Open the communication with a USB printer

Parameters
[in]pUsbDevthe USBDeviceStruct with all the parameters of the USB printer to open.
[out]pPrinterDevIDThe pointer to the device ID indicating which device the application will communicate to.
Returns
A CcwResult error code, or CcwResult_OK if the function succeeded.

◆ Present()

CcwResult Present ( int  device,
DWORD  dwpresentMM 
)

Send presentation command to the device

Parameters
[in]deviceThe device ID indicating which device the application will communicate to.
[in]dwpresentMMthe value (mm) of the presentation to send to the device.
Returns
A CcwResult error code, or CcwResult_OK if the function succeeded.

◆ PrintBarcodeBuffer()

CcwResult PrintBarcodeBuffer ( int  device,
BYTE *  bBrcBuffer,
DWORD  dwSrcBufferSize,
PrintBarcodeStruct pBarcodeStruct 
)

Print barcode file from buffer

Parameters
[in]deviceThe device ID indicating which device the application will communicate to.
[in]bBrcBufferpointer to buffer to print into barcode
[in]dwSrcBufferSizelength of buffer to print into barcode
[in]pBarcodeStructthe pointer to PrintBarcodeStruct with all the parameters / Attributes to use to print the barcode.
Returns
A CcwResult error code, or CcwResult_OK if the function succeeded.

◆ PrintBarcodeString()

CcwResult PrintBarcodeString ( int  device,
char *  strBrcText,
PrintBarcodeStruct pBarcodeStruct 
)

Print barcode file from String

Parameters
[in]deviceThe device ID indicating which device the application will communicate to.
[in]strBrcTextA null terminated string to print into barcode.
[in]pBarcodeStructthe pointer to PrintBarcodeStruct with all the parameters / Attributes to use to print the barcode.
Returns
A CcwResult error code, or CcwResult_OK if the function succeeded.

◆ PrinterIsReady()

CcwResult PrinterIsReady ( int  device,
BOOL *  pbReady 
)

Check if the device is ready

Parameters
[in]deviceThe device ID indicating which device the application will communicate to.
[out]pbReadyA pointer to a boolean value that is true if the communication with the device is ok.
Returns
A CcwResult error code, or CcwResult_OK if the function succeeded.

◆ PrintImageFromPath()

CcwResult PrintImageFromPath ( int  device,
char *  pstrImageFilePath,
PrintImageStruct pImageStruct 
)

Print image file from path.

Parameters
[in]deviceThe device ID indicating which device the application will communicate to.
[in]pstrImageFilePathA null terminated string with the file path.
[in]pImageStructthe pointer to PrintImageStruct with all the parameters / Attributes to use to print the image.
Note
The file formats supported are BMP, GIF, JPEG, PNG, TIFF, Exif, WMF, and EMF.
Returns
A CcwResult error code, or CcwResult_OK if the function succeeded.

◆ PrintRawImage()

CcwResult PrintRawImage ( int  device,
RAWBitDepth  bits,
BYTE *  pRawBuffer,
DWORD  dwRawBufferSize,
DWORD  dwWidth,
DWORD  dwHeight,
PrintImageStruct pImageStruct 
)

Print RAW image buffer.

Parameters
[in]deviceThe device ID indicating which device the application will communicate to.
[in]bitsbit deph of the RAW data
[in]pRawBufferpointer to RAW buffer to print
[in]dwRawBufferSizelength of RAW buffer to print
[in]dwWidthwidth (pixels/dots) of the of RAW image
[in]dwHeightheight (pixels/dots) of the of RAW image
[in]pImageStructthe pointer to PrintImageStruct with all the parameters / Attributes to use to print the image.
Note
For a correct Monochromatic RAW 1 bit buffer, the size must be always ((width in terms of bytes per row) * Height). About the colors palette, if the bit is 0 it will be a black dot and if if the bit is 1 it will be a white dot.
For a correct Greyscale RAW 8 bit buffer, the size must be always (Width * Height). About the colors palette, the byte 0x00 is the black and the 0xFF is the white.
For a correct RGB RAW 24 bit buffer, the size must be always (Width * Height * 3). About the colors palette, the color 0x000000 is the black and the 0xFFFFFF is the white.
Returns
A CcwResult error code, or CcwResult_OK if the function succeeded.

◆ PrintText()

CcwResult PrintText ( int  device,
char *  pText,
BOOL  bAddLF 
)

Print text on a printer.

Parameters
[in]deviceThe device ID indicating which device the application will communicate to.
[in]pTextA null terminated string to print.
[in]bAddLFThe boolean that is true if must be sent a line feed command after the text.
Note
This function uses the last font attributes (or the default one if never used) to print the text.
Returns
A CcwResult error code, or CcwResult_OK if the function succeeded.

◆ PrintTextEx()

CcwResult PrintTextEx ( int  device,
char *  pText,
PrintFontStruct pfontStruct,
BOOL  bAddLF 
)

Print text on a printer (with text parameters / Attributes ).

Parameters
[in]deviceThe device ID indicating which device the application will communicate to.
[in]pTextA null terminated string to print.
[in]pfontStructThe pointer to PrintFontStruct with all the parameters / Attributes to use to print the text.
[in]bAddLFThe boolean that is true if must be send a line feed command after the text.
Note
This function uses the last font attributes (or the default one if never used) to print the text.
Returns
A CcwResult error code, or CcwResult_OK if the function succeeded.

◆ PrintTextUTF8()

CcwResult PrintTextUTF8 ( int  device,
char *  pText,
PrintFontStruct pfontStruct,
BOOL  bAddLF 
)

Print UTF-8 text on a printer (with text parameters / Attributes ).

Parameters
[in]deviceThe device ID indicating which device the application will communicate to.
[in]pTextA null terminated UTF-8 encoded string to print.
[in]pfontStructThe pointer to PrintFontStruct with all the parameters / Attributes to use to print the text.
[in]bAddLFThe boolean that is true if must be sent a line feed command after the text.
Note
This function uses the last font attributes (or the default one if never used) to print the text.
Returns
A CcwResult error code, or CcwResult_OK if the function succeeded.

◆ SetCapPrintWidth()

CcwResult SetCapPrintWidth ( int  device,
DWORD  dwNewPrintWidth 
)

Set the print width of this device

Parameters
[in]deviceThe device ID indicating which device the application will communicate to.
[in]dwNewPrintWidthThe number that will be the print width (dots) of this device.
Returns
A CcwResult error code, or CcwResult_OK if the function succeeded.

◆ SetGrModeToBlackWhite()

CcwResult SetGrModeToBlackWhite ( int  device,
ImageGRMode  imgGrModeType,
BYTE  bThreshold 
)

Set the graphic conversion mode to Black/White and, if necessary, the threshold

Parameters
[in]deviceThe device ID indicating which device the application will communicate to.
[in]imgGrModeTypethe ImageGRMode conversion to black / white mode.
[in]bThresholdthe threshold value to use (only for ImageGRMode::IMAGE_GRMODE_THRESHOLD mode).
Returns
A CcwResult error code, or CcwResult_OK if the function succeeded.

◆ SetIgnoreWhiteImages()

CcwResult SetIgnoreWhiteImages ( int  device,
BOOL  bIgnore 
)

Set if ignore, or not, the white Images

Parameters
[in]deviceThe device ID indicating which device the application will communicate to.
[in]bIgnoreThe boolean that is true when a totally white Image must be ignored and not print (default is false).
Returns
A CcwResult error code, or CcwResult_OK if the function succeeded.

◆ SetPageModeToRoll()

CcwResult SetPageModeToRoll ( int  device,
BOOL  bRollMode 
)

Set the page mode print to Roll mode.

Parameters
[in]deviceThe device ID indicating which device the application will communicate to.
[in]bRollModeThe boolean that is true when the printer prints until the last not white line (default is false).
Returns
A CcwResult error code, or CcwResult_OK if the function succeeded.

◆ SetVariable()

CcwResult SetVariable ( int  device,
char *  var,
void *  value 
)

Set the value of an internal "parameter"

Parameters
[in]deviceThe device ID indicating which device the application will communicate to.
[in]varA null terminated string that is the variable ID.
[in]valuepointer to the value to assign to the variable.
Note
Only for internal use
Returns
A CcwResult error code, or CcwResult_OK if the function succeeded.

◆ TransactionPrint()

CcwResult TransactionPrint ( DWORD  device,
TrPrintMode  tpMode 
)

Manage the Transaction Print of the device

Parameters
[in]deviceThe device ID indicating which device the application will communicate to.
[in]tpModeTransaction control (see TrPrintMode).
Returns
A CcwResult error code, or CcwResult_OK if the function succeeded.